/*
 *
 *
 */

#include "gkt_types.h"

#ifndef USER_STASH_H
#define USER_STASH_H

typedef struct _user_stash_info {
	uint32_t	offset;
	uint32_t	size;
} user_stash_info_s;

typedef struct _user_stash_partition_header {
	user_partition_header_s	common;
	user_stash_info_s	info;
} user_stash_partition_header_s;
#define USER_STASH_PARTITION_HEADER_SIZE	\
	sizeof(user_stash_partition_header_s)

typedef struct _user_stash {
	const gkt_flash_partition_info_s	*c_flash_info;
	union {
		const user_stash_partition_header_s	*c_partition_header;
		user_stash_partition_header_s	*v_partition_header;
	};
} user_stash_s;
extern user_stash_s g_user_stash;

int user_stash_save(uint32_t type, 
		uint32_t offset, uint32_t size, void *data);
int user_stash_apply(const gkt_flash_partition_info_s *c_flash_info,
			void *data);
void user_stash_drop(uint32_t type);
void user_stash_reset(void);
void user_stash_init(void);

#endif	/* USER_STASH_H */

